package com.tanhua.manage.controller;

import com.tanhua.domain.db.Announcement;
import com.tanhua.manage.service.AnalysisService;
import com.tanhua.manage.vo.AnalysisSummaryVo;
import com.tanhua.manage.vo.AnalysisUsersVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/dashboard")
public class AnalysisController {
    @Autowired
    private AnalysisService analysisService;

    @GetMapping("/summary")
    public ResponseEntity summry() {
      AnalysisSummaryVo analysisSummaryVo= analysisService.summary();
      return ResponseEntity.ok(analysisSummaryVo);
    }
    @GetMapping("/users")
    public ResponseEntity getUsersCount(Long sd,Long ed,Integer type){
        AnalysisUsersVo analysisUsersVo= analysisService.getUsersCount(sd,ed,type);
        return ResponseEntity.ok(analysisUsersVo);
    }
}
